/**
 * 
 */
package com.laivi.basic.model.sql;

import java.util.List;

/**
 * @author laivi.zhu@gmail.com
 * @date 2014-7-3
 * description:
 */
public class Page<T> {
	private List<T> root;
	
	private int total;
	
	private int currentPage;
	
	private int pageSize;
	
	private int totalPage;
	
	public Page() {
		super();
	}

	public Page(List<T> root, int total, int currentPage, int pageSize) {
		super();
		this.root = root;
		this.total = total;
		this.currentPage = currentPage;
		this.pageSize = pageSize;
		if(this.total%this.pageSize==0){
			totalPage=this.total/this.pageSize;
		}else{
			totalPage=this.total/this.pageSize+1;
		}
	}

	public List<T> getRoot() {
		return root;
	}

	public void setRoot(List<T> root) {
		this.root = root;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

}
